package com.sxt.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sxt.redis.service.RedisService;

/**
 * 	数据解析处理类
 * 
 * @program: SpringBoot+Netty+Redis
 * @Date: 2020/09/23 09:20
 * @Author: luolin
 * @Description:
 */
@Component
public class PackageDataService {
	
	@Autowired
    private RedisService redisService;
	
	/**
	 * 	注册包数据处理
	 */
	public void registerHandler(String dataBody) {
		redisService.lSet("netty:register", dataBody);
	}
	/**
	 * 	心跳包数据处理
	 * @param dataBody
	 * @param success
	 */
	public void heartBeatHandler(String dataBody,Boolean success) {
		
	}
	
	/**
	 * 	终端状态包数据处理：网关发送注册包，服务器应答之后，获取终端状态数据帧，网关设备mac存于此数据帧
	 * @param dataBody
	 * @param success
	 * @return
	 */
	public String statusHandler(String dataBody,Boolean success) {
		return dataBody;
	}
	
	/**
	 * 	设备列表包数据处理
	 * @param dataBody
	 * @param success
	 */
	public void equipmentListHandler(String dataBody,Boolean success) {
		
	}
}
